/*
 * File:   main.cpp
 * Author: song
 *
 * Created on 2010年10月15日, 下午2:56
 */

#include <QtGui/QApplication>
#include<iostream>
using namespace std;
#include"DataForm.h"
#include"cv.h"
#include"highgui.h"
#include"cxcore.h"

int main(int argc, char *argv[]) {
    // initialize resources, if needed
    // Q_INIT_RESOURCE(resfile);

    //QApplication app(argc, argv);

    // create and show your widgets here
   // DataForm dataForm;
   // dataForm.show();

    CvCapture *capture = 0;
    capture = cvCaptureFromCAM(0);
    if(!capture) {
        cout<<"Failed"<<endl;
        return 0;
    }
    IplImage *frame = cvCreateImage(cvSize(900, 900), IPL_DEPTH_16U, 3);
    cvNamedWindow("Cam1", 0);
    while(capture){
        frame = cvQueryFrame(capture);
        cvShowImage("Cam1",frame);
        if(cvWaitKey(40) == 27) break;
    }

    cvReleaseImage(&frame);
    cvReleaseCapture(&capture);
    cvDestroyWindow("Cam1");


    return 0;
}
